<fieldset><legend style="font-size:16px">写邮件</legend>
<fieldset><legend>选择收件人</legend>
<form action="" method="POST">
	名字：<input type="text" name="usernames" id="usernames" value="{$usernames}" >
	<input type="button" onclick="this.form.page.value=1;this.form.action.value='searchuser';this.form.submit();" value="搜索" class="log2" align="right">

	<br><span id="nouser" style="color:red">{$nouserhint}</span>
	<br>
	<div id="searchresult" style="display:{if $noresult == 'true'}none{/if}">
		<table  cellpadding="1" border="0" width="100%">
			{section name=nr loop=$userlist}
			<tr >	
				<td style="border-bottom:1px solid #ccc;"><a href = "user.php?login={$userlist[nr].user_login}" target="_blank"><img src="{$userlist[nr].Avatar}" align="absmiddle"/> {$userlist[nr].user_names}</a></td>
				<td style="border-bottom:1px solid #ccc;"><input type="button" value=" 是收件人:)" id="reco" name="reco" style="text-decoration:none;background:#fff;border:1px solid #ccc;margin-right:1px;padding:2px 5px;color:#774525;" onmouseover="this.style.background='#774525';this.style.color='#fff';" onmouseout="this.style.background='#fff';this.style.color='#774525';" onclick="this.form.receiver.value = {$userlist[nr].user_id}; document.getElementById('receiver_names').innerHTML = '{$userlist[nr].user_names}'; document.getElementById('send_msg_hint').innerHTML = ''; document.getElementById('title').value = ''; document.getElementById('send_msg_content').value = ''; window.location.href='#writemsg'" /></td>
			</tr>
			{/section}
		</table>

		<input type="hidden" id="cur_page" name="cur_page" value={$cur_page} />
		<input type="hidden" id="page" name="page" value={$cur_page} />
		<input type="hidden" id="action" name="action" value="searchuser" />
		<input type="hidden" name="diggedlinkid" id="diggedlinkid" value="{$diggedlinkid}">
		<input type="hidden" name="checkdiggedlinkurl" id="checkdiggedlinkurl" value="{$checkdiggedlinkurl}">
		<input type="hidden" name="createownerurl" id="createownerurl" value="{$createownerurl}">
		<input type="hidden" name="owner" id="owner" value=0>
		<input type="hidden" name="phase" value=2>
{php} 
Global $db, $main_smarty, $rows, $top_users_size, $offset;
submit_user_do_pages($rows, $top_users_size, ''); 
{/php}
</div><!--this </div>is for the <div> from submit_user_do_pages()-->
</div>

	<div id="recouser" style="display:{if $norecouser == 'true'}none{/if}">
		<span style="color:#000">通讯录:</span><br>
		<table  cellpadding="1" border="0" width="100%">
			{section name=nr loop=$reco_userlist}
			<tr >	
				<td style="border-bottom:1px solid #ccc;"><a href = "user.php?login={$reco_userlist[nr].user_login}" target="_blank"><img src="{$reco_userlist[nr].Avatar}" align="absmiddle"/> {$reco_userlist[nr].user_names}</a></td>
				<td style="border-bottom:1px solid #ccc;"><input type="button" value=" 是收件人:)" id="reco2" name="reco2" style="text-decoration:none;background:#fff;border:1px solid #ccc;margin-right:1px;padding:2px 5px;color:#774525;" onmouseover="this.style.background='#774525';this.style.color='#fff';" onmouseout="this.style.background='#fff';this.style.color='#774525';" onclick="this.form.receiver.value = {$reco_userlist[nr].user_id};document.getElementById('receiver_names').innerHTML = '{$reco_userlist[nr].user_names}'; document.getElementById('send_msg_hint').innerHTML = ''; document.getElementById('title').value = ''; document.getElementById('send_msg_content').value = ''; window.location.href='#writemsg'" /></td>
			</tr>
			{/section}
		</table>

		<input type="hidden" id="reco_cur_page" name="reco_cur_page" value={$reco_cur_page} />
		<input type="hidden" id="reco_page" name="reco_page" value={$reco_cur_page} />
		<input type="hidden" id="norecouser" name="norecouser" value={$norecouser} />
{php} 
Global $db, $main_smarty, $reco_rows, $top_users_size, $offset;
reco_do_pages($reco_rows, $top_users_size, ''); 
{/php}
</div>
	</div><!--//end recouser div-->
</fieldset>

<a id="writemsg"></a>
<fieldset><legend>写并发送</legend>
	<span id="send_msg_hint"></span>
	<input type="hidden" id="receiver" value={$receiver} />
	<label>收件人:&nbsp;&nbsp;&nbsp;&nbsp;  <b><span id="receiver_names">{$receiver_names}</span></b></label>
	</form>
	<label>标题:</label>
	<input type="text" style="width:400px" id="title" name="title"/>
	<label>正文:</label>
	<textarea rows="14" cols="68" id="send_msg_content" name="send_msg_content" /></textarea><br/>			<br>
	<input type="button" value=" 发送 " onclick="sendnewmsg(document.getElementById('title').value,document.getElementById('receiver').value,{$sender},{$senderlevel})" class="log2"/>
	<!--<input type="button" value=" 发送 " onclick="window.alert();" class="log2">-->
</fieldset>
	
</fieldset>